package com.cl.controller;

import java.util.List;

import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

 


/**
 * 页面跳转controller
 * @author cl
 *
 */
@Controller
public class PageController {
	//@Autowired
	//private BUser user;
	//@Autowired
	//private AdminMainService ams;
	
	/**
	 * 跳转到首页(index.html)
	 * */
	@RequestMapping("/index")
	/*不返回一个modelandview回去 就无法让login页面的ajax传送的json自动装载成bean。*/
	public ModelAndView loginRedirect(HttpServletResponse res){
		res.setContentType("text/html;charset=UTF-8");
		ModelAndView md = new ModelAndView("index.html");
		//md.addObject(user);
		return md;
	}
	
	/**
	 * 跳转到申请(applyEAccount.html)
	 * */
	@RequestMapping("/applyEAccountPage")
	public ModelAndView mianRedirect(HttpServletResponse res){
		res.setContentType("text/html;charset=UTF-8");
		
		//BUser user = ams.queryBUserByPhone(phone);
		ModelAndView md = new ModelAndView("applyEAccount.html");
		//md.addObject("user",user);
		//获取举报数据
		//List<Complain> complains = ams.getComplains();
		//List<OnItems> onItems = ams.getOnItems();
	//	md.addObject("complains", complains);
		//md.addObject("onItems", onItems);
		
		return md;
	}
	
	/**
	 * 跳转到职位发布(enterprise_announce.html)
	 * */
	@RequestMapping("/enterprise_announce")
	/*不返回一个modelandview回去 就无法让login页面的ajax传送的json自动装载成bean。*/
	public ModelAndView enterpriseAnnounce(HttpServletResponse res){
		res.setContentType("text/html;charset=UTF-8");
		ModelAndView md = new ModelAndView("enterprise/enterprise_announce.html");
		//md.addObject(user);
		return md;
	}
	 
	/**
	 * 跳转到简历浏览 (enterprise_resume.html)
	 * */
	@RequestMapping("/enterprise_resume")
	/*不返回一个modelandview回去 就无法让login页面的ajax传送的json自动装载成bean。*/
	public ModelAndView enterpriseResume(HttpServletResponse res){
		res.setContentType("text/html;charset=UTF-8");
		ModelAndView md = new ModelAndView("enterprise/enterprise_resume.html");
		//md.addObject(user);
		return md;
	}
	 
	
	
	/**
	 * 跳转到发布简历 (person_resume_add.html)
	 * */
	@RequestMapping("/post_resume")
	/*不返回一个modelandview回去 就无法让login页面的ajax传送的json自动装载成bean。*/
	public ModelAndView postResume(HttpServletResponse res){
		res.setContentType("text/html;charset=UTF-8");
		ModelAndView md = new ModelAndView("person/person_resume_add.html");
		//md.addObject(user);
		return md;
	}
}
